package com.lanp.gencode.apifox.model;

import com.alibaba.fastjson.PropertyNamingStrategy;
import com.alibaba.fastjson.annotation.JSONType;
import com.fasterxml.jackson.databind.annotation.JsonNaming;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.Arrays;

/**
 * @author JiangPeng
 * Created with IntelliJ IDEA.
 * Description:  大客户返点协议子协议商品明细响应类
 * Date: 2024-02-18 11:50:58
 */
@Data
@NoArgsConstructor
@JSONType(naming = PropertyNamingStrategy.SnakeCase)
@JsonNaming(com.fasterxml.jackson.databind.PropertyNamingStrategy.SnakeCaseStrategy.class)
public class BigCustomRebateAgreementItemPo {
    /**
     * 大客户返点协议子协议id
     */
    private Long rebateChildId;
    /**
     * 大客户返点协议id
     */
    private Long rebateAgreementId;
    /**
     * 商品id
     */
    private Long productId;
    /**
     * 商品名称
     */
    private String productName;
    /**
     * 大客户商家ID
     */
    private Long customCompanyId;
    /**
     * 大B商家ID
     */
    private Long companyId;
    /**
     * 创建更新人
     */
    private String modUser;
    /**
     * 删除人
     */
    private String delUser;
    /**
     * 创建更新时间
     */
    private Long modTime;
    /**
     * 删除时间
     */
    private Long delTime;
    /**
     * 是否有效 1=有效 0=已删除
     */
    private Boolean available;

    public Long getRebateChildId() {
        return rebateChildId;
    }

    public void setRebateChildId(Long rebateChildId) {
        this.rebateChildId = rebateChildId;
    }

    public Long getRebateAgreementId() {
        return rebateAgreementId;
    }

    public void setRebateAgreementId(Long rebateAgreementId) {
        this.rebateAgreementId = rebateAgreementId;
    }

    public Long getProductId() {
        return productId;
    }

    public void setProductId(Long productId) {
        this.productId = productId;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public Long getCustomCompanyId() {
        return customCompanyId;
    }

    public void setCustomCompanyId(Long customCompanyId) {
        this.customCompanyId = customCompanyId;
    }

    public Long getCompanyId() {
        return companyId;
    }

    public void setCompanyId(Long companyId) {
        this.companyId = companyId;
    }

    public String getModUser() {
        return modUser;
    }

    public void setModUser(String modUser) {
        this.modUser = modUser;
    }

    public String getDelUser() {
        return delUser;
    }

    public void setDelUser(String delUser) {
        this.delUser = delUser;
    }

    public Long getModTime() {
        return modTime;
    }

    public void setModTime(Long modTime) {
        this.modTime = modTime;
    }

    public Long getDelTime() {
        return delTime;
    }

    public void setDelTime(Long delTime) {
        this.delTime = delTime;
    }

    public Boolean getAvailable() {
        return available;
    }

    public void setAvailable(Boolean available) {
        this.available = available;
    }

    @Override
    public String toString() {
        return com.alibaba.fastjson.JSON.toJSONString(this);
    }

    public enum Column {
        rebateChildId("rebate_child_id", "rebateChildId", "BIGINT", false),
        rebateAgreementId("rebate_agreement_id", "rebateAgreementId", "BIGINT", false),
        productId("product_id", "productId", "BIGINT", false),
        productName("product_name", "productName", "VARCHAR", false),
        customCompanyId("custom_company_id", "customCompanyId", "BIGINT", false),
        companyId("company_id", "companyId", "BIGINT", false),
        modUser("mod_user", "modUser", "VARCHAR", false),
        delUser("del_user", "delUser", "VARCHAR", false),
        modTime("mod_time", "modTime", "BIGINT", false),
        delTime("del_time", "delTime", "BIGINT", false),
        available("available", "available", "BIT", false);

        private static final String BEGINNING_DELIMITER = "`";

        private static final String ENDING_DELIMITER = "`";

        private final String column;

        private final boolean isColumnNameDelimited;

        private final String javaProperty;

        private final String jdbcType;

        Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
            this.column = column;
            this.javaProperty = javaProperty;
            this.jdbcType = jdbcType;
            this.isColumnNameDelimited = isColumnNameDelimited;
        }

        public static Column[] excludes(Column... excludes) {
            ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
            if (excludes != null && excludes.length > 0) {
                columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
            }
            return columns.toArray(new Column[]{});
        }

        public static Column[] all() {
            return Column.values();
        }

        public String value() {
            return this.column;
        }

        public String getValue() {
            return this.column;
        }

        public String getJavaProperty() {
            return this.javaProperty;
        }

        public String getJdbcType() {
            return this.jdbcType;
        }

        public String desc() {
            return this.getEscapedColumnName() + " DESC";
        }

        public String asc() {
            return this.getEscapedColumnName() + " ASC";
        }

        public String getEscapedColumnName() {
            if (this.isColumnNameDelimited) {
                return BEGINNING_DELIMITER + this.column + ENDING_DELIMITER;
            } else {
                return this.column;
            }
        }

        public String getAliasedEscapedColumnName() {
            return this.getEscapedColumnName();
        }
    }
}